<?php

/**
 * actionwf form base class.
 *
 * @method actionwf getObject() Returns the current form's model object
 *
 * @package    forumCDE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseactionwfForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                     => new sfWidgetFormInputHidden(),
      'owner_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('owner'), 'add_empty' => true)),
      'description'            => new sfWidgetFormInputText(),
      'ordre'                  => new sfWidgetFormInputText(),
      'etatorigine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatorigine'), 'add_empty' => false)),
      'etatdestine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatdestine'), 'add_empty' => false)),
      'role_id'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('role'), 'add_empty' => false)),
      'commentaire'            => new sfWidgetFormTextarea(),
      'debuttraitement'        => new sfWidgetFormInputCheckbox(),
      'fintraitement'          => new sfWidgetFormInputCheckbox(),
      'fermetechnique'         => new sfWidgetFormInputCheckbox(),
      'ferme'                  => new sfWidgetFormInputCheckbox(),
      'recalculedelai'         => new sfWidgetFormInputCheckbox(),
      'readonly'               => new sfWidgetFormInputCheckbox(),
      'commentaireobligatoire' => new sfWidgetFormInputCheckbox(),
      'icon'                   => new sfWidgetFormInputText(),
      'visibilite'             => new sfWidgetFormInputText(),
      'addattach'              => new sfWidgetFormInputCheckbox(),
      'externaliser'           => new sfWidgetFormInputCheckbox(),
      'signature'              => new sfWidgetFormInputCheckbox(),
      'fieldsmodif_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('fieldsmodif'), 'add_empty' => true)),
      'sansmails'              => new sfWidgetFormInputCheckbox(),
      'rolesnotification'      => new sfWidgetFormInputText(),
      'messageclient'          => new sfWidgetFormTextarea(),
      'clientmail_id'          => new sfWidgetFormInputText(),
      'mailvalideur_id'        => new sfWidgetFormInputText(),
      'mailnotification_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('mailnotification'), 'add_empty' => true)),
      'dossierautomatique_id'  => new sfWidgetFormInputText(),
      'messageutilisateur'     => new sfWidgetFormTextarea(),
      'created_at'             => new sfWidgetFormDateTime(),
      'updated_at'             => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'owner_id'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('owner'), 'required' => false)),
      'description'            => new sfValidatorString(array('max_length' => 100)),
      'ordre'                  => new sfValidatorInteger(),
      'etatorigine_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etatorigine'))),
      'etatdestine_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etatdestine'))),
      'role_id'                => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('role'))),
      'commentaire'            => new sfValidatorString(array('required' => false)),
      'debuttraitement'        => new sfValidatorBoolean(array('required' => false)),
      'fintraitement'          => new sfValidatorBoolean(array('required' => false)),
      'fermetechnique'         => new sfValidatorBoolean(array('required' => false)),
      'ferme'                  => new sfValidatorBoolean(array('required' => false)),
      'recalculedelai'         => new sfValidatorBoolean(array('required' => false)),
      'readonly'               => new sfValidatorBoolean(array('required' => false)),
      'commentaireobligatoire' => new sfValidatorBoolean(array('required' => false)),
      'icon'                   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'visibilite'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'addattach'              => new sfValidatorBoolean(array('required' => false)),
      'externaliser'           => new sfValidatorBoolean(array('required' => false)),
      'signature'              => new sfValidatorBoolean(array('required' => false)),
      'fieldsmodif_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('fieldsmodif'), 'required' => false)),
      'sansmails'              => new sfValidatorBoolean(array('required' => false)),
      'rolesnotification'      => new sfValidatorPass(array('required' => false)),
      'messageclient'          => new sfValidatorString(array('required' => false)),
      'clientmail_id'          => new sfValidatorInteger(array('required' => false)),
      'mailvalideur_id'        => new sfValidatorInteger(array('required' => false)),
      'mailnotification_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('mailnotification'), 'required' => false)),
      'dossierautomatique_id'  => new sfValidatorInteger(array('required' => false)),
      'messageutilisateur'     => new sfValidatorString(array('required' => false)),
      'created_at'             => new sfValidatorDateTime(),
      'updated_at'             => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('actionwf[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'actionwf';
  }

}
